//
//  UIButton+HMUtilities.m
//
//
//  Created by 谭伟 on 16/10/10.
//  Copyright © 2016年 谭伟. All rights reserved.
//

#import "UIButton+HMUtilities.h"

@implementation UIButton (HMUtilities)

+ (instancetype)buttonWithTitle:(NSString *)title textColor:(UIColor *)color andSize:(CGFloat)fontsize
{
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
//    btn.titleLabel.text = title; 错误方式
    [btn setTitle:title forState:UIControlStateNormal];
    
    btn.titleLabel.font = [UIFont systemFontOfSize:fontsize];
    btn.titleLabel.textColor = color;
    
    return btn;
}

+ (instancetype)buttonWithTitle:(NSString *)title image:(UIImage *)normalImage andHighLight:(UIImage *)highLightImage
{
    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [btn setTitle:title forState:UIControlStateNormal];
    
    [btn setImage:normalImage forState:UIControlStateNormal];
    [btn setImage:highLightImage forState:UIControlStateHighlighted];
    
    return btn;
}

@end
